//
//	GoodScoreModel.swift
//
//	Create by 松 松 on 14/5/2019
//	Copyright © 2019. All rights reserved.
//	Model file generated using JSONExport: https://github.com/Ahmed-Ali/JSONExport

import Foundation


open class GoodScoreModel : NSObject, NSCoding, SSMap{

	public var allScore : Int!
	public var appCode : String!
	public var averageScore : Int!
	public var commentNum : Int!
	public var commitScoreNum : Int!
	public var mainTypeCode : Int!
	public var merchantId : String!
	public var toItemCode : String!

    public override init() {
        
    }

	/**
	 * Instantiate the instance using the passed dictionary values to set the properties values
	 */
    required public init(fromDictionary dictionary: [String:Any]){
		allScore = dictionary["allScore"] as? Int
		appCode = dictionary["appCode"] as? String
		averageScore = dictionary["averageScore"] as? Int
		commentNum = dictionary["commentNum"] as? Int
		commitScoreNum = dictionary["commitScoreNum"] as? Int
		mainTypeCode = dictionary["mainTypeCode"] as? Int
		merchantId = dictionary["merchantId"] as? String
		toItemCode = dictionary["toItemCode"] as? String
	}

	/**
	 * Returns all the available property values in the form of [String:Any] object where the key is the approperiate json key and the value is the value of the corresponding property
	 */
    public func toDictionary() -> [String:Any]
	{
		var dictionary = [String:Any]()
		if allScore != nil{
			dictionary["allScore"] = allScore
		}
		if appCode != nil{
			dictionary["appCode"] = appCode
		}
		if averageScore != nil{
			dictionary["averageScore"] = averageScore
		}
		if commentNum != nil{
			dictionary["commentNum"] = commentNum
		}
		if commitScoreNum != nil{
			dictionary["commitScoreNum"] = commitScoreNum
		}
		if mainTypeCode != nil{
			dictionary["mainTypeCode"] = mainTypeCode
		}
		if merchantId != nil{
			dictionary["merchantId"] = merchantId
		}
		if toItemCode != nil{
			dictionary["toItemCode"] = toItemCode
		}
		return dictionary
	}

    /**
    * NSCoding required initializer.
    * Fills the data from the passed decoder
    */
    @objc required public init(coder aDecoder: NSCoder)
	{
         allScore = aDecoder.decodeObject(forKey: "allScore") as? Int
         appCode = aDecoder.decodeObject(forKey: "appCode") as? String
         averageScore = aDecoder.decodeObject(forKey: "averageScore") as? Int
         commentNum = aDecoder.decodeObject(forKey: "commentNum") as? Int
         commitScoreNum = aDecoder.decodeObject(forKey: "commitScoreNum") as? Int
         mainTypeCode = aDecoder.decodeObject(forKey: "mainTypeCode") as? Int
         merchantId = aDecoder.decodeObject(forKey: "merchantId") as? String
         toItemCode = aDecoder.decodeObject(forKey: "toItemCode") as? String

	}

    /**
    * NSCoding required method.
    * Encodes mode properties into the decoder
    */
    @objc public func encode(with aCoder: NSCoder)
	{
		if allScore != nil{
			aCoder.encode(allScore, forKey: "allScore")
		}
		if appCode != nil{
			aCoder.encode(appCode, forKey: "appCode")
		}
		if averageScore != nil{
			aCoder.encode(averageScore, forKey: "averageScore")
		}
		if commentNum != nil{
			aCoder.encode(commentNum, forKey: "commentNum")
		}
		if commitScoreNum != nil{
			aCoder.encode(commitScoreNum, forKey: "commitScoreNum")
		}
		if mainTypeCode != nil{
			aCoder.encode(mainTypeCode, forKey: "mainTypeCode")
		}
		if merchantId != nil{
			aCoder.encode(merchantId, forKey: "merchantId")
		}
		if toItemCode != nil{
			aCoder.encode(toItemCode, forKey: "toItemCode")
		}

	}

}
